﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.MultiUserAdminPageBase" %>
<script language="c#" runat="server">
protected string CurrentCategoryID
{
	get
	{
		if (!String.IsNullOrEmpty(Request.QueryString["CategoryID"]) && Request.QueryString["CategoryID"] != Guid.Empty.ToString())
			return Request.QueryString["CategoryID"];
		else if (Request.Cookies["CategoryID"] != null)
			return Request.Cookies["CategoryID"].Value;
		else
			return "";
	}
}
</script>
<section data-page="menu_list" data-title="菜单列表">
	<div class="path1"><span>您的位置：</span>菜单列表</div>
	<form action="" class="search1">
		<select name="CategoryID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
			<option value="" data-item="0" data-parent="0">未指定</option>
			<ali:Tree Object="MenuCategory" Validate="True">
				<ali:Record>
					<%If Convert.ToString(ID) == CurrentCategoryID%>
						<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>" selected><%=Name%></option>
					<%Else%>
						<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><%=Name%></option>
					<%EndIf%>
					<%=ChildRecords%>
				</ali:Record>
			</ali:Tree>
		</select>
	</form>
	<div class="content">
		<table data-ali-widget="grid" class="grid1" data-tree="true" data-root="0">
			<thead>
				<tr>
					<th width="40">编号</th>
					<th>名称</th>
					<th width="80">删除</th>
				</tr>
			</thead>
			<tbody>
				<ali:Tree Object="Menu" Condition="CategoryID=CurrentCategoryID" Validate="True">
					<ali:Record>
						<tr data-id="<%=InnerID%>">
							<td data-sort="<%=InnerID%>"><%=InnerID%></td>
							<th data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><a href="edit.aspx?ID=<%=InnerID%>" target="ali-navtab"><%=Name%></a></th>
							<td><a class="ali-button" data-operation="delete">删除</a></td>
						</tr>
						<%=ChildRecords%>
					</ali:Record>
				</ali:Tree>
			</tbody>
		</table>
	</div>
</section>